/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mindwave.theoracle;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author MarcoJ
 */
public class experienceBean {

    private List Collection = null;
    private double Battery;
    private double PoorSignal;
    private double Attention;
    private double Meditation;
    private double Raw;
    private double Delta;
    private double Theta;
    private double LowAlpha;
    private double HighAlpha;
    private double HighBeta;
    private double LowBeta;
    private double LowGamma;
    private double HighGamma;
    private double BlinkStrength;
    private String Image;
    private double Time;
    private Figure Figura;
    private double p3;

    public experienceBean(String[] data) {
        //metodo da implementare        
    }

    public experienceBean(ThinkGear tg, int connID, int img, long currenTime) {

        this.Time = System.currentTimeMillis() - currenTime;
        this.Attention = tg.TG_GetValue(connID, 2);
        this.Battery = tg.TG_GetValue(connID, 0);
        this.BlinkStrength = tg.TG_GetValue(connID, 37);
        this.Delta = tg.TG_GetValue(connID, 5);
        this.Image = Figure.getName(img);
        this.HighAlpha = tg.TG_GetValue(connID, 8);
        this.HighGamma = tg.TG_GetValue(connID, 12);
        this.HighBeta = tg.TG_GetValue(connID, 10);
        this.LowAlpha = tg.TG_GetValue(connID, 7);
        this.LowBeta = tg.TG_GetValue(connID, 9);
        this.LowGamma = tg.TG_GetValue(connID, 11);
        this.Meditation = tg.TG_GetValue(connID, 3);
        this.PoorSignal = tg.TG_GetValue(connID, 1);
        this.Raw = tg.TG_GetValue(connID, 4);
        this.Theta = tg.TG_GetValue(connID, 6);
        this.Figura = Figure.valueOf(Image);
        this.p3 = 0;
    }

    public List getCollection() {
        if (this.Collection == null);
        getList();
        return Collection;
    }
    
    
    public double getHighBeta() {
        return HighBeta;
    }

    public void setHighBeta(double HighBeta) {
        this.HighBeta = HighBeta;
    }

    public String getImage() {
        return Image;
    }

    public void setImage(String Image) {
        this.Image = Image;
    }
    
    
    public double isP3() {
        return p3;
    }

    public void setP3(double p3) {
        this.p3 = p3;
    }



    public String[] getStringArray() {
        return getStringList().toArray(new String[17]);
    }

    public List getList() {

        this.Collection = new ArrayList();

        this.Collection.add(Battery);
        this.Collection.add(PoorSignal);
        this.Collection.add(Attention);
        this.Collection.add(Meditation);
        this.Collection.add(Raw);
        this.Collection.add(Delta);
        this.Collection.add(Theta);
        this.Collection.add(LowAlpha);
        this.Collection.add(HighAlpha);
        this.Collection.add(LowBeta);
        this.Collection.add(HighBeta);
        this.Collection.add(LowGamma);
        this.Collection.add(HighGamma);
        this.Collection.add(BlinkStrength);
        this.Collection.add(Image);
        this.Collection.add(Time);
        this.Collection.add(p3);
        return this.Collection;
    }

    public List<String> getStringList() {
        getList();
        List<String> temp = new ArrayList<String>();
        for (int i = 0; i < Collection.size(); i++) {
            if (!(Collection.get(i) instanceof String)) {
                temp.add(Double.toString((double) Collection.get(i)));
            } else {
                temp.add((String) Collection.get(i));
            }
        }

        return temp;
    }

    public double getBattery() {
        return Battery;
    }

    public void setBattery(double Battery) {
        this.Battery = Battery;
    }

    public double getPoorSignal() {
        return PoorSignal;
    }

    public void setPoorSignal(double PoorSignal) {
        this.PoorSignal = PoorSignal;
    }

    public double getAttention() {
        return Attention;
    }

    public void setAttention(double Attention) {
        this.Attention = Attention;
    }

    public double getMeditation() {
        return Meditation;
    }

    public void setMeditation(double Meditation) {
        this.Meditation = Meditation;
    }

    public double getRaw() {
        return Raw;
    }

    public void setRaw(double Raw) {
        this.Raw = Raw;
    }

    public double getDelta() {
        return Delta;
    }

    public void setDelta(double Delta) {
        this.Delta = Delta;
    }

    public double getTheta() {
        return Theta;
    }

    public void setTheta(double Theta) {
        this.Theta = Theta;
    }

    public double getLowAlpha() {
        return LowAlpha;
    }

    public void setLowAlpha(double LowAlpha) {
        this.LowAlpha = LowAlpha;
    }

    public double getHighAlpha() {
        return HighAlpha;
    }

    public void setHighAlpha(double HighAlpha) {
        this.HighAlpha = HighAlpha;
    }

    public double getLowBeta() {
        return LowBeta;
    }

    public void setLowBeta(double LowBeta) {
        this.LowBeta = LowBeta;
    }

    public double getLowGamma() {
        return LowGamma;
    }

    public void setLowGamma(double LowGamma) {
        this.LowGamma = LowGamma;
    }

    public double getHighGamma() {
        return HighGamma;
    }

    public void setHighGamma(double HighGamma) {
        this.HighGamma = HighGamma;
    }

    public double getBlinkStrength() {
        return BlinkStrength;
    }

    public void setBlinkStrength(double BlinkStrength) {
        this.BlinkStrength = BlinkStrength;
    }

    public Figure getFigure() {
        return Figura;
    }

    public void setFigure(Figure Figure) {
        this.Figura = Figure;
        
    }

    public double getTime() {
        return Time;
    }

    public void setTime(double Time) {
        this.Time = Time;
    }
}
